<template>
  <div id="cinemas">
    <Header></Header>
    <div class="contenr">
      <div class="region" v-for="obj in cinemaList" :key="obj.cinemaId">
        <div class="left">
          <div class="top">{{obj.name}}</div>
          <div class="bottom">
            {{obj.address}}
          </div>
        </div>
        <div class="right">
          <div class="price">￥<span>{{obj.lowPrice}}</span>起</div>
          <div class="distance">距离未知</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Header from './components/header.vue'
import { getCinemas } from '../../api/movieApi'
export default {
  name: 'Cinemas',
  components: {
    Header
  },
  data(){
    return {
      cinemaList: []
    }
  },
  mounted(){
    getCinemas().then((res) => {
          this.cinemaList = res.splice(0,10)
    })
  }
}
</script>

<style lang="less" scoped>
.contenr {
  margin-top: 93px;
  padding-bottom: 50px;
  .region {
    height: 45px;
    padding: 15px 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ced2d6;
    .left {
      flex: 4;
      .top {
        font-size: 15px;
      }
      .bottom {
        font-size: 12px;
        color: #797d82;
        width: 250px;
        line-height: 30px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    .right {
      flex: 1;
      text-align: center;
      .price{
        color: #ff5f16;
        font-size: 6px;
        span{
          font-size: 16px;
        }
      }
      .distance{
        color: #797d82;
        font-size: 12px;
        line-height: 30px;
      }
    }
  }
}
</style>
